package org.grottarossa.driver;

import java.io.Serializable;

import org.grottarossa.driver.ECMDriver;
import org.grottarossa.driver.Identity;
import org.grottarossa.template.drivers.components.CaseManagement;
import org.grottarossa.template.drivers.components.DiscussionManagement;
import org.grottarossa.template.drivers.components.DocumentManagement;
import org.grottarossa.template.drivers.components.PortalManagement;
import org.grottarossa.template.drivers.components.RecordManagement;
import org.grottarossa.template.drivers.components.SearchEngine;
import org.grottarossa.template.drivers.components.UserManagement;
import org.grottarossa.template.drivers.components.WorkflowManagement;

public abstract class ECMBuilderTemplate implements Serializable{

	/**
	 *
	 */
	private static final long serialVersionUID = -6813204880415700615L;

	protected Identity identity;
	protected ECMDriver driver;

	public ECMDriver getDriver() { return driver;}

	public ECMBuilderTemplate()
	{
	}

	public ECMBuilderTemplate(Identity identity) {
		this.setIdentity(identity);
	}

	protected void createNewDriver()
	{
		driver = new ECMDriver();
		driver.setCaseManagement(getCaseManagement());
		driver.setDocumentManagement(getDocumentManagement());
		driver.setPortalManagement(getPortalManagement());
		driver.setWorkflowManagement(getWorkflowManagement());
		driver.setRecordManagement(getRecordManagement());
		driver.setDiscussionManagement(getDiscussionManagement());
		driver.setUserManagement(getUserManagement());
		driver.setSearchEngine(getSearchEngine());
	}

	protected void setIdentity(Identity identity) {
		this.identity = identity;
	}

	public Identity getIdentity() {
		return this.identity;
	}

	public abstract CaseManagement getCaseManagement();
	public abstract PortalManagement getPortalManagement();
	public abstract WorkflowManagement getWorkflowManagement();
	public abstract DocumentManagement getDocumentManagement();
	public abstract RecordManagement getRecordManagement();
	public abstract DiscussionManagement getDiscussionManagement();
	public abstract UserManagement getUserManagement();
	public abstract SearchEngine getSearchEngine();
}
